/**
 * 商家管理
 */
import request from "@/utils/request";
import formurlencoded from "form-urlencoded";

// 商家申请列表
export function applyListSearchSeller(query) {
  return request({
    url: "/admin/seller/audit/list",
    method: "get",
    params: query,
  });
}
// 获取注册地-城市列表
export function getRegionListSeller(query) {
  return request({
    url: "/admin/regions/getRegionByParentId",
    method: "get",
    params: query,
  });
}
// 提交信息，添加商家申请
export function createApplySeller(data) {
  return request({
    url: "/admin/seller/audit/create",
    method: "post",
    data: formurlencoded(data),
  });
}
// 商家申请编辑-获取信息
export function editApplySeller(query) {
  return request({
    url: "/admin/seller/audit/edit",
    method: "get",
    params: query,
  });
}
// 商家申请编辑-更新修改
export function updateApplySeller(data) {
  return request({
    url: "/admin/seller/audit/update",
    method: "post",
    data: formurlencoded(data),
  });
}
// 商家申请-审核通过
export function passApplySeller(query) {
  return request({
    url: "/admin/seller/audit/pass",
    method: "get",
    params: query,
  });
}
// 商家申请-审核驳回
export function rejectApplySeller(query) {
  return request({
    url: "/admin/seller/audit/reject",
    method: "get",
    params: query,
  });
}
// 商家申请-删除
export function deleteApplySeller(query) {
  return request({
    url: "/admin/seller/audit/delete",
    method: "get",
    params: query,
  });
}

// 商家管理列表
export function manageListSeller(query) {
  return request({
    url: "/admin/seller/manage/list",
    method: "get",
    params: query,
  });
}
// 商家管理-停用
export function freezeManageSeller(query) {
  return request({
    url: "/admin/seller/manage/freeze",
    method: "get",
    params: query,
  });
}
// 商家管理-启用
export function unfreezeManageSeller(query) {
  return request({
    url: "/admin/seller/manage/unfreeze",
    method: "get",
    params: query,
  });
}

// 商家公告列表
export function noticeListSeller(query) {
  return request({
    url: "/admin/systemNotice/list",
    method: "get",
    params: query,
  });
}
// 商家公告-创建
export function createNoticeSeller(data) {
  return request({
    url: "/admin/systemNotice/create",
    method: "post",
    data: formurlencoded(data),
  });
}
// 商家公告-编辑-获取信息
export function editNoticeSeller(query) {
  return request({
    url: "/admin/systemNotice/edit",
    method: "get",
    params: query,
  });
}
// 商家公告-编辑-更新修改
export function updateNoticeSeller(data) {
  return request({
    url: "/admin/systemNotice/update",
    method: "post",
    data: formurlencoded(data),
  });
}
// 商家公告-置顶
export function toTopNoticeSeller(query) {
  return request({
    url: "/admin/systemNotice/totop",
    method: "post",
    params: query,
  });
}
// 商家公告-删除
export function deleteNoticeSeller(query) {
  return request({
    url: "/admin/systemNotice/del",
    method: "post",
    params: query,
  });
}

// 结算管理列表
export function settlementListSeller(query) {
  return request({
    url: "/admin/settlement/list",
    method: "get",
    params: query,
  });
}
// 结算管理列表-查看详情信息
export function detailSettlementSeller(query) {
  return request({
    url: "/admin/settlement/detail",
    method: "get",
    params: query,
  });
}
// 结算管理列表-查看详情信息-获取已完成订单
export function checkdetailOrderListSeller(query) {
  return request({
    url: "/admin/settlement/orderlist",
    method: "get",
    params: query,
  });
}
// 结算管理列表-查看详情信息-获取已取消订单
export function checkdetailBackListSeller(query) {
  return request({
    url: "/admin/settlement/backlist",
    method: "get",
    params: query,
  });
}
// 结算管理列表-发起结算
export function settleStartSeller(data) {
  return request({
    url: "/admin/settlement/settleStart",
    method: "post",
    data: formurlencoded(data),
  });
}
// 结算管理列表-回复质疑
export function platformExplainSeller(data) {
  return request({
    url: "/admin/settlement/platformExplain",
    method: "post",
    data: formurlencoded(data),
  });
}
// 结算管理列表-对账完成
export function checkOverSeller(query) {
  return request({
    url: "/admin/settlement/checkOver",
    method: "post",
    params: query,
  });
}
// 结算管理列表-打款
export function payOverSeller(query) {
  return request({
    url: "/admin/settlement/payOver",
    method: "post",
    params: query,
  });
}
//商家进件申请
export function sellerApplyments(query) {
  return request({
    url: "/admin/seller/manage/applyments",
    method: "get",
    params: query,
  });
}
//支付宝商家进件申请
export function sellerApplymentsAli(query) {
  return request({
    url: "/admin/seller/manage/applymentsAli",
    method: "get",
    params: query,
  });
}

// 查询商家配置详细
export function getConfig(id) {
  return request({
    url: '/admin/seller/config/selectSellerConfigById?sellerId=' + id,
    method: 'get'
  })
}

// 新增或修改商家配置
export function addOrEditConfig(data) {
  return request({
    url: '/admin/seller/config/addOrUpdate',
    method: 'post',
    data: data
  })
}

// 删除商家配置
export function delConfig(id) {
  return request({
    url: '/admin/seller/config/' + id,
    method: 'delete'
  })
}

// 更新商户状态
export function updateStatus(data) {
  return request({
    url: '/admin/seller/manage/updateStatus',
    method: 'post',
    data: data
  })
}

// 更新商户状态
export function queryCount(query) {
  return request({
    url: '/admin/seller/manage/queryCount',
    method: 'get',
    params: query
  })
}

// 查询商家申请数量
export function queryApplyCount(query) {
  return request({
    url: '/admin/seller/audit/queryApplyCount',
    method: 'get',
    params: query
  })
}